package com.haixiaoke.saas.bill.mapper;

import com.haixiaoke.saas.bill.domain.HouseBill;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 入住账单Mapper接口
 *
 * @author qixi
 * @date 2024-05-30
 */
public interface HouseBillMapper {
    /**
     * 查询入住账单
     *
     * @param billId 入住账单主键
     * @return 入住账单
     */
    HouseBill selectHouseBillByBillId(String billId);

    /**
     * 查询入住账单列表
     *
     * @param houseBill 入住账单
     * @return 入住账单集合
     */
    List<HouseBill> selectHouseBillList(HouseBill houseBill);

    /**
     * 新增入住账单
     *
     * @param houseBill 入住账单
     * @return 结果
     */
    int insertHouseBill(HouseBill houseBill);

    /**
     * 修改入住账单
     *
     * @param houseBill 入住账单
     * @return 结果
     */
    int updateHouseBill(HouseBill houseBill);

    /**
     * 删除入住账单
     *
     * @param billId 入住账单主键
     * @return 结果
     */
    int deleteHouseBillByBillId(String billId);

    /**
     * 批量删除入住账单
     *
     * @param billIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteHouseBillByBillIds(String[] billIds);

    List<HouseBill> selectNotActivatedHouseBillList();

    void updateHouseBillBillEffectiveStates(@Param("billIds") List<String> billIds, @Param("billEffectiveStates") String billEffectiveStates);

    List<HouseBill> selectInvalidHouseBillList(HouseBill houseBill);

    List<HouseBill> selectHouseBillByOrderId(String orderId);

    int batchInsert(List<HouseBill> list);

    int updateBillEnableStates(@Param("lesseeContractId") String lesseeContractId, @Param("enableStates") String enableStates);

    List<HouseBill> selectEffectiveHouseBillList();


    List<HouseBill> selectOvertimeBill();

    /**
     * 查询生效的入住账单列表
     *
     * @return
     */
    List<HouseBill> selectTakeEffectHouseBillList();

    int updateHouseBillPayState(@Param("billIds") List<String> billIds, @Param("payState") String payState);

    List<HouseBill> selectHouseBillListByLesseeContractId(String lesseeContractId);

    List<HouseBill> selectHouseBillByHouseIds(String[] houseIds);

    int selectOutstandingByOrderId(String orderId);
}
